//调用接口配置文件
import { request } from 'config/request'
import config from '../../../config/config'
// 定义接口


//编辑时查询数据
export async function queryInfo (params) {
  return request({
    // url: `admin/commissionApply/listDetails`,
    url: `admin/commissionApply/listDetailsNew`,
    method: 'POST',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}
//录入保存
export async function save (params) {
    return request({
      // url: `admin/commissionApply/insert`,
      url: `admin/commissionApply/insertNew`,
      method: 'POST',
      data: params,
      headers: {
        'Content-type': 'application/json',
      }
    })
  }

//生成佣金明细 
export async function create (params) {
  return request({
    // url: `admin/commissionApply/generateApplyDetails`,
    url: `admin/commissionApply/generateApplyDetailsNew`,
    method: 'POST',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}
//佣金明细 /删除
export async function ondelete (params) {
  return request({
    url: `admin/commissionApply/generateApplyDetailsDelete`,
    method: 'POST',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}

//导出
export async function down(params) {
  return request({
      url: `admin/commissionApply/exportDetails`,
      method: 'POST',
      data: params,
      headers: {
        'Content-type': 'application/json',
      }
  });
};

//根据项目ID查核算主体
export async function searchAccountingName (params) {
  return request({
    url: `3rd/commission/queryMecEntityProjectVl`,
    method: 'POST',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}

//获取汇客通uat环境tokenid url
export async function getMcrmAdmin (params) {
  return request({
    url: `http://112.74.60.235/mcrm-admin/thirdLogin/getTokenId`,
    method: 'POST',
    data: params,
    headers: {
      'Content-type': 'application/json',
    }
  })
}


// 上传附件
export async function importAccount(params) {
  return request({
      url: 'admin/commissionApply/importApplyDetail',
      method: 'POST',
      headers: {
          "Content-type": "application/json"
      },
      data: params
  });
};

//项目名称过滤
export async function projectFilter(params) {
  return request({
      url: 'admin/commissionRule/accountIdProjectId',
      method: 'GET',
      data: params,
  });
};

// 校验退房信息接口
export async function queryCheckOut(params) {
  return request({
      url: '3rd/commission/queryCheckOut',
      method: 'POST',
      headers: {
          "Content-type": "application/json"
      },
      data: params
  });
};

// 联名客户修改提交接口
export async function saveLmHandleUnionBuy(params) {
  return request({
      url: 'admin/commissionApply/saveLmHandleUnionBuy',
      method: 'POST',
      headers: {
          "Content-type": "application/json"
      },
      data: params
  });
};

// 联名客户列表接口
export async function queryApplyDetailLm(params) {
  return request({
      // url: 'admin/commissionApply/queryApplyDetailLm',
      url: 'admin/commissionApply/queryApplyDetailLmNew',
      method: 'POST',
      headers: {
          "Content-type": "application/json"
      },
      data: params
  });
};
// 联名客户明细
export async function queryLmDetail(params) {
  return request({
      url: 'admin/commissionApply/queryLmDetail',
      method: 'POST',
      headers: {
          "Content-type": "application/json"
      },
      data: params
  });
};

// 关联原佣金申请单明细
export async function listAssociated(params) {
  return request({
      url: 'admin/commissionApply/listAssociated',
      method: 'POST',
      headers: {
          "Content-type": "application/json"
      },
      data: params
  });
};

// 同步数据
export async function startTaskDto(params) {
  return request({
      url: '/admin/commissionApply/startTaskDto',
      method: 'POST',
      headers: {
          "Content-type": "application/json"
      },
      data: params
  });
};

// 重选联名购房
export async function lmReChooseList(params) {
  return request({
      url: 'admin/commissionApply/lmReChooseList',
      method: 'POST',
      headers: {
          "Content-type": "application/json"
      },
      data: params
  });
};

// 同步成功状态
export async function isSyncTheProject(params) {
  return request({
      url: `admin/commissionApply/isSyncTheProject/${params.projectId}`,
      method: 'POST',
      headers: {
          "Content-type": "application/json"
      },
  });
};

//查询线索失效信息
export async function queryClueByClueId(params) {
  return request({
      url: '/admin/commission/queryClueByClueId',
      method: 'POST',
      data: params,
  });
};

